console.log(" INFO  Starting init vue.config.js");
const path = require('path')

function resolve(dir) {
	return path.join(__dirname, dir)
}
//
const ConvertPagesPlugin = require("./plugins/convertPagesPlugin.js")
//
module.exports = {
	configureWebpack: {
		plugins: [
			new ConvertPagesPlugin({
				rootPath: __dirname,
				writePath: "plugins",
				writeName: "app.ext.js"
			})
		]
	},
	chainWebpack: (config) => {
		//
		config.module
			.rule('svg')
			.exclude.add(resolve('static/icons'))
			.end()
		config.module
			.rule('icons')
			.test(/\.svg$/)
			.include.add(resolve('static/icons'))
			.end()
			.use('svg-sprite-loader')
			.loader(path.resolve(__dirname, './node_modules/svg-sprite-loader'))
			.options({
				symbolId: 'icon-[name]'
			})
			.end()
	},
}